using System.Collections.Immutable;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using SageKing.Designer.Core;
using SageKing.Designer.Core.Attributes;
using SageKing.Designer.Core.Contracts; 
using JetBrains.Annotations;

namespace SageKing.Designer.Core.Activities;

/// <summary>
/// Branch execution into multiple branches.
/// </summary>
[Activity("SageKing", "Control Flow", "Branch execution into multiple branches.")]
[PublicAPI]
[Browsable(false)]
public class Fork : Activity
{
    /// <inheritdoc />
    public Fork([CallerFilePath] string? source = default, [CallerLineNumber] int? line = default) : base(source, line)
    { 
    }

    /// <summary>
    /// Controls when this activity yields control back to its parent activity.
    /// </summary>
    [Input(
        Description = "Controls when this activity yields control back to its parent activity.",
        UIHint = InputUIHints.DropDown
    )]
    public ForkJoinMode JoinMode { get; set; } = ForkJoinMode.WaitAll;

    /// <summary>
    /// The branches to schedule.
    /// </summary>
    public ICollection<IActivity> Branches { get; set; } = new List<IActivity>();
     
}